home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Aminet 23
/
Aminet 23 (1998)(GTI - Schatztruhe)[!][Feb 1998].iso
/
Aminet
/
dev
/
misc
/
gms_dev.lha
/
GMSDev
/
Source
/
E
/
Screens
/
DoubleBuffer.e
next >
Wrap
Text File
|
1997-12-23
|
2KB
|
59 lines
/* Name: Double Buffering
** Author: Paul Manias
** Copyright: DreamWorld Productions (c) 1996-1997. Freely distributable.
**
** This just shows how to double buffer the screen. You can also try out
** triple buffering just by changing the DBLBUFFER flag to TPLBUFFER in the
** Screen.
*/
MODULE 'dpkernel','dpkernel/dpkernel','graphics/pictures','files/files'
MODULE 'screens','system/register','system/modules','input/joydata'
MODULE 'graphics/screens','graphics/blitter'
PROC main()
DEF picture:PTR TO picture, screen:PTR TO screen, joydata:PTR TO joydata
DEF picfile:filename, scrmodule:PTR TO module
picfile := [ ID_FILENAME, 'GMS:demos/data/PIC.Green' ]:filename
IF dpkbase := OpenLibrary('GMS:libs/dpkernel.library',0)
IF (scrmodule := Init([TAGS_MODULE,NIL,
MODA_NUMBER, MOD_SCREENS,
MODA_TABLETYPE, JMP_AMIGAE,
TAGEND], NIL))
scrbase := scrmodule.modbase
IF (picture := Load(picfile, ID_PICTURE))
screen := Get(ID_SCREEN)
CopyStructure(picture,screen)
screen.memptr1 := picture.bitmap.data
screen.attrib := DBLBUFFER OR CENTRE
IF (screen := Init(screen,NIL))
IF (joydata := Init(Get(ID_JOYDATA),NIL))
Display(screen)
Query(joydata)
REPEAT
WaitAVBL()
SwapBuffers(screen)
Query(joydata)
UNTIL (joydata.buttons AND JD_LMB)
Free(joydata)
ENDIF
Free(picture)
ENDIF
Free(screen)
ENDIF
Free(scrmodule)
ENDIF
CloseDPK()
ENDIF
ENDPROC